<%@page import="com.junsi.bean.Staff"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
  <% Staff staff=(Staff)request.getSession().getAttribute("staff");  %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=9">
        <link rel="stylesheet" href="<%=basePath %>css/cssreset.css">
        <link rel="stylesheet" href="<%=basePath %>css/pagination.css">
        <link rel="stylesheet" href="<%=basePath %>css/style.css">
        <link rel="stylesheet" href="<%=basePath %>css/style2.css">
        <link rel="stylesheet" href="<%=basePath%>css/mycss.css">
        <link rel="stylesheet" href="<%=basePath%>css/mystyle.css"> 
        <script src="<%=basePath %>js/jquery-1.11.1.min.js"></script>
        <style>
        	.bianji{
				width: 552px;
				height: 369px;
				border:1px solid #ccc;
				border-radius:5px;
				position:absolute;
				top:110px;
				left:50%;
				margin-left:-260px;
				background:#fff;
				display:none;
				z-index:1;
			}
			.bianji>p{
				width:100%;
				line-height:42px;
				text-indent:2em;
				color:#818181;
				border-bottom:1px solid #dddddd;
			}
			.bianji>p>img{
				cursor:pointer;
				position:relative;
				left:426px;
			}
			.bianji>form>p{
				text-align:center;
				margin-bottom:21px;
				color:#555555;
				overflow:hidden;
			}
			.bianji>form>p>span:nth-of-type(2){
				color:red;
				margin-left:10px;
			}
			
			.bianji>form>p:nth-of-type(1){
				margin-top:19px;
				
			}
			.bianji>form>p>input{
				float:none;
				width:300px;
				height:28px;
				text-align:left;
				margin-left:50px;
				outline:none;
				border:1px solid #ccc;
				border-radius:5px;
			}
			
			.bianji>form>p:nth-of-type(7){
				width:100%;
				height:32px;
				background:#dfe4ea;
				padding:10px 0;
			}
			.bianji>form>p:nth-of-type(7)>input{
				width: 56px;
				line-height: 28px;
				background:#57c049;
				border:none;
				border-radius:5px;
				color:#fff;
				position:relative;
				left:160px;
				cursor:pointer;
				text-align:center;
			}
			.bianji>form>p:nth-of-type(7)>input:nth-of-type(1){
				left:190px;
				background:#ccc;
			}
			.smallsa{
				width:100%;
				height:1062px;
				position:absolute;
				top:0px;
				left:0px;
				background:rgba(0,0,0,0.2);
				display:none;
			}
        </style>
        
       
    </head>
    <body>
    	<div class="bigbox xlbox">
    		<nav class="daohan">
                <ul>
                	<li class="sh1">
                        <a href="<%=basePath %>notice/findByAll.action" id="sline"><p class="mline"><span class="smallicon" id="current111"></span><span class="navtxt" id="current2">首页</span></p></a>  
                    </li>
                    <li>
                        <a href="<%=basePath %>client/qiangenzongcount.action?zhuizong=0"  ><p class="mline"><span class="smallicon" id="current11"></span><span class="navtxt"  >用户开发</span></p></a>
                    </li>
                    <li>
                        <a href="<%=basePath %>client/selectDepOrSta.action?start=1">
                            <p class="mline">
                                <span class="smallicon" id="ziji11"></span>
                                <span class="navtxt">代理开发</span>
                            </p>
                        </a>
                    </li>
                    <%--  <li class="sh2">
                        <a href="<%=basePath %>client/selectByStaffAnd.action"><p class="mline"><span class="smallicon one1"></span><span class="navtxt">客户资料</span><span class="ripic"></span></p></a>
                        <div class="showhide2">
                            <a href="<%=basePath %>client/selectByStaffAnd.action" style="font-size:14px;background:#435565;">
                             <p class="mline mline2">
                                <span class="smallicon" id="ziji3"></span>
                                <span class="navtxt" style="font-size: 14px;color:#929da8;">用户资料</span>
                             </p>
                             </a> 

                             <a href="<%=basePath %>client/selectByStaffAnd.action?start=1" style="font-size:14px;background:#435565;">
                             <p class="mline mline2">
                                <span class="smallicon" id="ziji34"></span>
                                <span class="navtxt" id="current2" style="font-size: 14px;color:#929da8;">代理资料</span>
                             </p>
                             </a>    
                        </div>
                    </li> --%>
                    <li>
                        <a href="<%=basePath %>approve/count.action?pageSize=0"><p class="mline"><span class="smallicon one2"></span><span class="navtxt">合同审批</span></p></a> 
                    </li>
                    <li>
                         <a href="<%=basePath%>page/pacts.jsp">
                             <p class="mline"><span class="smallicon one222"></span><span class="navtxt">审批详情</span></p>
                         </a>
                        
                    </li>
                    
                     <li>
                        <a href="<%=basePath %>Operate/count.action">
                             <p class="mline"><span class="smallicon" id="yunyin2"></span><span class="navtxt">运营管理</span></p>
                         </a>
                    </li>  
                    
                   <li>
                        <a href="#"><p class="mline"><span class="smallicon one3"></span><span class="navtxt">产品资源库</span></p></a>
                    </li>
                    <c:if test="${backstage == 1}">
                    	<li>
	                        <a href="<%=basePath %>client/findByAllGr.action"><p class="mline"><span class="smallicon one333"></span><span class="navtxt">后台管理</span></p></a>
	                    </li>
                    </c:if>
                </ul>
            </nav>
            
    		<div class="showbox">
                <h2>
                <span class="exit"><span class="ex1" style="cursor:pointer;">姓名:<%=staff.getStaff_name()%></span>
					<a href="../login/tuichustaff.action" class="ex2"><span class="exicon2"></span>切换账号</a>
					<a href="../login/tuichustaff.action" class="ex3"><span class="exicon3"></span>退出账号</a>
				</span></h2>
                <div class="showbox2">
	    		
	    			<div class="aaa">
		    			<div class="smalltitle leaf">
							<h3>公告</h3> 
		    			</div>
	    				<c:forEach items="${list}" var="list">
	    				<div class="apprcontent">
	    				<div class="content">
	    					<div class="zhengwen">&nbsp;&nbsp;&nbsp;&nbsp;${list.notice_text}
	    					<p class="kright">${list.notice_releaseDate}</p>
	    					</div>	
	    				</div>	   							
    				    </div>
    					</c:forEach>		
    				</div>
	    			</div>
	    			
					 
	    		</div>
	    	</div>
            <div class="bianji">
	    		<p>信息修改<img src="../images/guanbi.png" alt="" class="gb"></p>
	    		<form action="javascript:update()" method="post" onsubmit="return textas()">
	    			<input type="hidden" disabled="disabled" id="staffId" value="<%=staff.getStaff_id()%>">
	    			<p><span style="margin-right:43px;">姓 名</span><input type="text" disabled="disabled" id="xingming" value="<%=staff.getStaff_name()%>"></p>
	    			<c:choose>
	    		  <c:when test="<%=staff.getStaff_phone()!=null%>">
	    			<p><span style="margin-right:28px;">手 机 号</span><input type="text" id="shoujihao" value="<%=staff.getStaff_phone()%>"><span>*</span></p>
	    			</c:when>
	    			<c:when test="<%=staff.getStaff_phone()==null%>">
	    			<p><span style="margin-right:28px;">手 机 号</span><input type="text" id="shoujihao" value=""><span>*</span></p>
	    			</c:when>
	    			</c:choose>
	    			<p><span style="margin-right:28px;">旧 密 码</span><input type="hidden" id="mimajiu" value="<%=staff.getStaff_password()%>"><input type="text" name="password" id="mimatian" value="<%=staff.getStaff_password()%>"><span>*</span></p> 
	    			<p><span style="margin-right:28px;">新 密 码</span><input type="password" name="password" class="newpass" id="mima" value=""><span>*</span></p>
	    			<p><span style="margin-right:10px;">确 认密 码</span><input type="password" name="password" class="newspass" id="" value=""><span>*</span></p>
	    			<c:choose>
	    			 <c:when test="<%=staff.getStaff_email()!=null%>">
	    			<p><span style="margin-right:19px;">邮 箱 号</span><input type="text" id="youxiang" value="<%=staff.getStaff_email()%>"><span>*</span></p>
	    			</c:when>
	    			 <c:when test="<%=staff.getStaff_email()==null%>">
	    			 <p><span style="margin-right:19px;">邮 箱 号</span><input type="text" id="youxiang" value=""><span>*</span></p>
	    			 </c:when>
	    			</c:choose>
	    			<p><input type="button" value="取消" class="qi"><input type="submit" value="确定"></p>
	    		</form>
	    	</div>
    		<div class="smallsa"></div>
    	 
    </body>
    <script>
    function update(){
    	var url="${pageContext.request.contextPath}/staff/qianupdate.action";
		var pam={
				staff_id:$("#staffId").val(),
				staff_password:$("#mima").val(),
				staff_phone:$("#shoujihao").val(),
				staff_userName:$("#xingming").val(),
				staff_email:$("#youxiang").val()	
				};
		
		$.post(url,pam,function(data){		
				location="${pageContext.request.contextPath}/notice/findByAll.action";
	});
    }
    
    $('.ex1').click(function(){
    	$('.bianji').css('display','block');
    	$('.smallsa').css('display','block');
    })
    $('.gb').click(function(){
    	$('.bianji').css('display','none');
    	$('.smallsa').css('display','none');
    })
     $('.qi').click(function(){
    	$('.bianji').css('display','none');
    	$('.smallsa').css('display','none');
    })
            $(function(){
            	
            		$(".apprcontent:gt(2)").hide();
            	
            	
                 
                $('.sh2').mouseover(function(event) {
                    $('.showhide2').css('display', 'block');
                });
                $('.sh2').mouseout(function(event) {
                    $('.showhide2').css('display', 'none');
                });
                 
            })
            function textas(){
		    	var shoujihao=$("#shoujihao").val();
		    	var mima=$("#mimatian").val();
		    	var mimajiu=$("#mimajiu").val();
		    	var newpass=$(".newpass").val();
		    	var newspass=$(".newspass").val();
		    	var p=/\s/;
		    	if(shoujihao==""||p.test(shoujihao)){
		    		alert("请填写手机号！");
		    		return false;
		    	}else if(mima!=mimajiu){
		    		alert("输入的密码不一致！");
		    		return false;
		    	}else if(newpass==mima){
		    		alert("输入的密码不能与旧密码一致！");
		    		return false;
		    	}else if(newpass==""||p.test(newpass)){
		    		alert("请输入新密码！");
		    		return false;
		    	}else if(newspass==""||p.test(newspass)){
		    		alert("请再次输入新密码！");
		    		return false;
		    	}else if(newspass!=newpass){
		    		alert("与重新设置的密码不相同，请重新输入！");
		    		return false;
		    	}
		    	return true;
		    }
        </script> 
</html>
